<template>
  <a-scrollbar ref="scrollContainer" class="scroll-container" @wheel.prevent="handleScroll">
    <slot />
  </a-scrollbar>
</template>

<script lang="ts">
import importConfig from './ScrollPane.ts';
import { toRefs, defineExpose } from 'vue';

export default {
  name: 'ScrollPane',
  emits: ['scroll'],
  setup(props, { emit }) {
    const { base, scrollContainer, tagsViewStore, visitedViews, scrollWrapper, handleScroll, emitScroll, moveToTarget } = importConfig({
      emit,
    });

    defineExpose({ moveToTarget });

    return {
      ...toRefs(base),
      scrollContainer,
      tagsViewStore,
      visitedViews,
      scrollWrapper,
      handleScroll,
      emitScroll,
      moveToTarget,
    };
  },
};
</script>

<style lang="less" scoped>
:deep(.arco-scrollbar-container) {
  text-align: left;
  overflow: hidden;
}
</style>
